var mysql = require('mysql');
var pool = mysql.createPool({
	host: 'localhost',
	port: 3306,
	user: 'root',
	password: 'root',
	database: 'test',	multipleStatements: true
});

pool.getConnection(function(err, conn) {
	if (err) {
		conn.end();
		throw err
	};

	conn.query('select name,id from user', function(err, rows) {

		if (err) {
			conn.end();
			throw err
		};
		console.log(rows);

		conn.end();
		pool.end();

	});
});